package com.yjd.bi.business.dao.impl;

import java.util.Map;

import org.springframework.stereotype.Component;

import com.yjd.bi.business.dao.IInvestInfoDao;
import com.yjd.bi.business.model.InvestInfoModel;
import com.yjd.comm.base.dao.impl.BaseDaoImpl;

/**
 * <b>description</b>：投资项目数据访问层 <br>
 * <b>time</b>：2016-06-27 17:21:51 <br>
 * <b>author</b>： zhoujin@yijiedai.com
 */
@Component("investInfoDao")
public class InvestInfoDaoImpl extends BaseDaoImpl implements IInvestInfoDao {

	private static final String SQLMAPNAMESPACE = InvestInfoModel.class.getName();
	private static final String PKNAME = "id";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}

	@Override
	public Double getInvestPriceActual(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		Object myObject = this.getSqlMap(false).queryForObject(this.getStatement("getInvestPriceActual"),paramMap);
		if (myObject != null) {
			return Double.parseDouble(myObject.toString());
		}
		return 0.00D;
	}

	@Override
	public Double getInvestAmountActual(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		Object myObject = this.getSqlMap(false).queryForObject(this.getStatement("getInvestAmountActual"),paramMap);
		if (myObject != null) {
			return Double.parseDouble(myObject.toString());
		}
		return 0.00D;
	}

	@Override
	public Double getInvestPriceOver(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		Object myObject = this.getSqlMap(false).queryForObject(this.getStatement("getInvestPriceOver"),paramMap);
		if (myObject != null) {
			return Double.parseDouble(myObject.toString());
		}
		return 0.00D;
	}

	@Override
	public Double getInvestAmountOver(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		Object myObject = this.getSqlMap(false).queryForObject(this.getStatement("getInvestAmountOver"),paramMap);
		if (myObject != null) {
			return Double.parseDouble(myObject.toString());
		}
		return 0.00D;
	}

	@Override
	public Double getrecycledPrice(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		Object myObject = this.getSqlMap(false).queryForObject(this.getStatement("getrecycledPrice"),paramMap);
		if (myObject != null) {
			return Double.parseDouble(myObject.toString());
		}
		return 0.00D;
	}

	@Override
	public Double getFundsSum(Map<String, Object> paramMap, boolean b) {
		Object myObject = this.getSqlMap(b).queryForObject(this.getStatement("usersSum"),paramMap);
		if (myObject != null) {
			return Double.parseDouble(myObject.toString());
		}
		return 0.00D;
	}

	
}
